/*
 *    Copyright (c) 2018-2025, boss All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions are met:
 *
 * Redistributions of source code must retain the above copyright notice,
 * this list of conditions and the following disclaimer.
 * Redistributions in binary form must reproduce the above copyright
 * notice, this list of conditions and the following disclaimer in the
 * documentation and/or other materials provided with the distribution.
 * Neither the name of the boss developer nor the names of its
 * contributors may be used to endorse or promote products derived from
 * this software without specific prior written permission.
 * Author: boss
 */

package com.hopes.bizz.poll.om.service;

import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.IService;
import com.hopes.bizz.poll.om.dto.PollDataAlterDto;
import com.hopes.bizz.poll.om.dto.PollRtDataDTO;
import com.hopes.bizz.poll.om.entity.BaseOmDataEntity;
import com.hopes.bizz.poll.om.entity.PollRtDataHisEntity;
import com.hopes.bizz.poll.om.vo.PollRtDataVO;
import com.hopes.bizz.poll.pollaqi.entity.Aqi;

import java.util.List;

/**
 * 实时监控数据历史
 *
 * @author daijie
 * @date 2023-05-23 15:29:53
 */
public interface PollRtDataHisService extends IService<PollRtDataHisEntity>, PollAnalysisService, MonitorHisService {

    /**
     * 根据监控点及数据类型删除的所有数据
     *
     * @param omDataEntity
     */
    void deleteByMonitorSiteIdAndDataTime(BaseOmDataEntity omDataEntity);


    // 根据时间和监控点list查询数据
    List<PollRtDataHisEntity> queryByTimeAndMonitorList(PollRtDataDTO pollRtDataDTO);

    /**
     * 处理计算AQI任务
     *
     * @param dataO
     * @param sumO
     */
    void handleCalculateAQITask(JSONObject dataO, JSONObject sumO, String valKey);
    void handleCalculateWQITask(JSONObject dataO, JSONObject sumO, String valKey);

    Aqi calculateAQI(JSONObject sumO);
    Aqi calculateWQI(JSONObject sumO);

    IPage<PollRtDataVO> queryByMonitorAndTimeType(Page<PollRtDataVO> page, PollRtDataDTO pollRtData);

    /**
     * @Description 修约数据
     * @Author lyb
     * @Date 2023/9/26
     **/
    void alter(PollDataAlterDto pollDataAlterDto);
}
